/*建筑用途后台*/
'use strict';
const buildingUseAddAction = require('../actions/buildingUse/buildingUseAddAction');
const buildingUseDelAction = require('../actions/buildingUse/buildingUseDelAction');
const buildingUseUpdateAction = require('../actions/buildingUse/buildingUseUpdateAction');
const buildingUseQueryAction = require('../actions/buildingUse/buildingUseQueryAction');

module.exports = async function (ctx) {
    let param = ctx.method === 'GET' ? ctx.query : ctx.request.fields;
    let action_type = param.action_type;
    try {
        switch (action_type) {
            case 'buildingUseAdd': //建筑用途添加
                ctx.body = await buildingUseAddAction(param);
                break;
            case 'buildingUseDel': //建筑用途删除
                ctx.body = await buildingUseDelAction(param);
                break;
            case 'buildingUseUpdate': //建筑用途修改
                ctx.body = await buildingUseUpdateAction(param);
                break;
            case 'buildingUseQuery': //建筑用途查询
                ctx.body = await buildingUseQueryAction(param);
                break;

        }
    } catch (e) {
        ctx.body = {success: false, message: e.message};
    }

};